package com.huike.controller;

import com.huike.log.Log;
import com.huike.report.vos.BaseDataVO;
import com.huike.report.vos.ToDoListVO;
import com.huike.report.vos.TodayBriefingVO;
import com.huike.result.Result;
import com.huike.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * 首页
 */
@RestController
@RequestMapping("api/report/turnove")
public class ReportController {
    @Autowired
    private ReportService reportService;

    /**
     * 基础数据查询
     * @param begin
     * @param end
     * @return
     */
    @Log(title = "首页模块")
    @GetMapping("/baseData")
    public Result findBaseData(@DateTimeFormat (pattern = "yyyy-M-d") String begin,@DateTimeFormat (pattern = "yyyy-M-d")String end){
        return reportService.findBaseData(begin,end);
    }

    /**
     * 今日简报查询
     * @return
     */
    @Log(title = "首页模块")
    @GetMapping("/todayBriefing")
    public Result findTodayBriefing(){
        return reportService.findTodayBriefing();
    }
    /**
     * 待办事项
     *
     * @return
     */
    @Log(title = "首页模块")
    @GetMapping("/toDoList")
    public Result toDoList() {
        return reportService.toDoList();
    }

    /**
     * 线索转化漏斗
     * @param begin
     * @param end
     * @return
     */
    @Log(title = "首页模块")
    @GetMapping("/clueConvert")
    public Result clueConvert(@DateTimeFormat (pattern = "yyyy-M-d") String begin,
                              @DateTimeFormat (pattern = "yyyy-M-d")String end){
        return reportService.clueConvert(begin,end);
    }
    /**
     * 线索龙虎榜
     * @param begin
     * @param end
     * @return
     */
    @Log(title = "首页模块")
    @GetMapping("/clueList")
    public Result clueList(@DateTimeFormat(pattern = "yyyy-M-d") String begin,
                           @DateTimeFormat(pattern = "yyyy-M-d") String end){
        return reportService.clueList(begin,end);
    }
    /**
     * 商机龙虎榜
     * @param begin
     * @param end
     * @return
     */
    @Log(title = "首页模块")
    @GetMapping("/businessList")
    public Result businessList(@DateTimeFormat(pattern = "yyyy-M-d") String begin,
                               @DateTimeFormat(pattern = "yyyy-M-d") String end){
        return reportService.businessList(begin,end);
    }
}
